package cn.uniqueinfo.dp.vo;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
/**
 * @author:朱元勋
 * @mail:395910063@qq.com
 * @date:2019-01-30 16:40:31
 * @description:菜单表
 */
@Data
public class MenuVO extends BaseVO {
    /** 父id 0=顶级菜单 */
    private Long ipid;
    /** 名称 */
    private String menuName;
    /** 图标 */
    private String menuIcon;
    /** 菜单路径 */
    private String menuPath;
    /** 排序 */
    private Integer showOrder;
    /** 菜单类型0=系统1=自定义 */
    private Integer menuType;
    /** 菜单为自定义时必填 */
    private String formName;
    /** 菜单备注 */
    private String menuComment;

    private Long _parentId;
    private String text;
    private String iconCls;

    public String getIconCls() {
        return (this.menuIcon == null || this.menuName == "") ? "icon-default" : this.menuIcon;
    }

    public String getText() {
        return this.menuName;
    }

    @JSONField(name = "_parentId")
    public Long get_parentId() {
        if (this.ipid == 0) {
            return null;
        } else {
            return this.ipid;
        }
    }
}
